{extend name="mainadmin@layouts/base" /}
{block name="main" }

<header class="header  b-b clearfix">
    <form id="forms" class="talbe-search form-inline "  method="post" action="{:url('getList')}" >
     <div class="page-breadcrumbs">
            <ul class="breadcrumb" >
                <li>
                    <i class="fa fa-ellipsis-v"></i>
                    <strong>充值管理</strong>
                </li>                                  
            </ul>
           <select name="status"  style="width: 100px;" data-toggle="select2" data-notsearch="true"  data-chang="submit"  >
               <option value="-1">所有状态</option>
               {volist name="$status" id="val"}
                <option value="{$key}" {$search['status']==$key?'selected':''}>{$val}</option>
               {/volist}
            </select>
             <select name="pay_id"  style="width: 110px;" data-toggle="select2" data-notsearch="true"  data-chang="submit"  >
             <option value="">所有充值方式</option>
             {volist name="payList" id="vo" }
             	{eq name="vo.is_recharge" value="1"}
             		<option value="{$vo.pay_id}" {$search['pay_id']==$vo['pay_id']?'selected':''}>{$vo.pay_name}</option>
                {/eq}
             {/volist}
            </select>
         <select name="type"  style="width: 120px;" data-toggle="select2" data-notsearch="true" data-chang="submit"  >
             <option value="">所有充值类型</option>
             {volist name="typeList" id="val" }
             <option value="{$key}" >{$val}</option>
             {/volist}
         </select>
           <div class="form-group">
                <a class="btn btn-default " data-toggle="reportrange" data-change="submit">
                    <i class="fa fa-calendar fa-lg"></i>
                    <small>充值时间</small>
                    <span></span> <b class="caret"></b>
                    <input type="hidden" value="{$start_date} - {$end_date}" id="reportrange" name="reportrange" />
                </a>
          </div>
          <input type="text"  style="width: 120px;" class="form-control " value="{$search.keyword}" name="keyword" placeholder="会员ID/姓名/手机号码" data-rule-required="true" />
          <button class="btn btn-sm btn-default-iq" type="submit" title="搜索"><i class="fa fa-search"></i></button>
         <a href="#" class="btn statc_btn" data-toggle="ajaxModal"><i class="fa fa-pie-chart"></i>查看统计</a>
         <button class="btn" type="submit" id="export_btn" ><i class="fa fa-cloud-download"></i>导出报表</button>
         
    </div>
</form>
</header>

<section class="scrollable wrapper w-f ">
    <section class="panel panel-default ">
        <div class="table-responsive " id="list_box">
            {include file="sys_admin/recharge/list" /}
        </div>
    </section>
</section>
<script type="text/javascript">
    $('.statc_btn').click(function () {
        var reportrange = window.btoa($('#reportrange').val());
        $(this).attr('href','{:_url("statc",["reportrange"=>"【reportrange】"])}');
    })
    $('#export_btn').click(function(){
        $('.talbe-search').append('<input type="hidden" name="is_export" id="is_export" value="1">').submit();
        $('#is_export').remove();
    })
    $(document).on('click','.operatbtn',function(){
        $('#operating').val($(this).data('type'));
        $('.postBtn').click();
    })
</script>
{/block}
